<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePlanJoinTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('plan_join', function (Blueprint $table) {
            $table->increments('id')     ->comment('id');
            $table->integer('user_id')   ->default(0)->comment('用户id');
            $table->integer('plan_id')   ->default(0)->comment('计划id');
            $table->integer('sex')       ->default(0)->comment('性别');
            $table->string('trade')      ->nullable()->comment('职业');
            $table->string('job_name')   ->nullable()->comment('工作');
            $table->string('birthday')   ->nullable()->comment('生日年份');
            $table->string('province')   ->nullable()->comment('省份');
            $table->string('city')       ->nullable()->comment('城市');
            $table->string('area')       ->nullable()->comment('地区');
            $table->decimal('amount')    ->default(0)->comment('会员金额');
            $table->integer('is_pay')    ->default(0)->comment('支付状态');
            $table->timestamp('pay_time')->nullable()->comment('支付时间');
            $table->string('pay_type')   ->nullable()->comment('支付方法');
            $table->integer('is_select') ->nullable()->comment('是否被选中');
            $table->integer('is_contact')->nullable()->comment('是否标记为联系');
            $table->integer('status')    ->default(0)->comment('计划状态，1：正常，2：锁定');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
